<template>
<slot :controller="controller" :store="store" :model="model">
    <AppBasisViewLayout :class="classNames" :openType="openType">
        <template #default>
            <slot name="IBIZOrderTabExpViewtabexppanelTabExpPanel" :controller="controller" :store="store" :model="model" :actions="{ handleCtrlInit, handleCtrlAction, handleCtrlDestroy }">
                <IBIZOrderTabExpViewtabexppanelTabExpPanel
                    
                    name="tabexppanel"
                    v-bind="model.ctrlParams.IBIZOrdertabexppanel"
                    :context="store.context"
                    :viewParams="store.viewParams"
                    :closeView="store.closeView"
                    :pLoadingHelper="store.loadingHelper"
                    :pViewCtx="store.viewCtx"
                    @ctrl-init="(name:string, ability:any) => { handleCtrlInit(controller, name, ability) }"
                    @ctrl-action="(name:string, action:any, data:any) => { handleCtrlAction(controller, name, action, data) }"
                    @ctrl-destroy="(name:string, data:any) => { handleCtrlDestroy(controller, name, data) }"    >
                    <template #viewCaption v-if="!noViewCaption && model.showCaption">
                        <slot name="ViewCaption" :controller="controller" :store="store" :model="model">
                            <AppCaptionBar :caption="model.caption" :title="model.title" :capPSLanguageRes="model.capPSLanguageRes" :titlePSLanguageRes="model.titlePSLanguageRes" :openType="openType"></AppCaptionBar>
                        </slot>
                        <slot name="ViewDataInfoBar" :controller="controller" :store="store" :model="model">
                            <AppDataInfoBar v-if="model.showDataInfoBar" :dataInfo="store.dataInfo"></AppDataInfoBar>
                        </slot>
                    </template>
                </IBIZOrderTabExpViewtabexppanelTabExpPanel>
            </slot>
        </template>
    </AppBasisViewLayout>
</slot>
</template>
<script lang="ts" setup>
// 基于template/src/views/{{appModules}}/{{pages@DETABEXPVIEW}}/{{spinalCase page.codeName}}-base.vue.hbs生成
import { AppBasisViewLayout } from "@components/layout/basis-view-layout";
import IBIZOrderTabExpViewtabexppanelTabExpPanel from '@widgets/ibiz-order/tab-exp-viewtabexppanel-tab-exp-panel/tab-exp-viewtabexppanel-tab-exp-panel.vue';
import { IEvent, IParam, ITabExpViewAbility, ITabExpViewStore, TabExpViewActionType } from '@/core';
import { useController, useProps, useBasic, useAction} from './ibiz-order-tab-exp-view-hook';

// 输入参数
const props = defineProps(useProps());

// 基础数据
const { 
    model,
    getClassNames, 
    useNavParamsBind,
	useEventBind,
    handleQuickSearch,
  	handleToolbarItemClick,
    handleComponentAction,
	handleCtrlAction,
	handleCtrlInit,
	handleCtrlDestroy
} = useBasic(props);

const emit = defineEmits<{
    (event: 'view-action', name: string, action: TabExpViewActionType, data: IParam[]): void;
    (event: 'view-init', name: string, data: ITabExpViewAbility): void;
    (event: 'view-mounted', name: string, data: IParam): void;
    (event: 'view-destroy', name: string, data: IParam): void;
}>();

const evt = useEventBind(emit);
const classNames = computed(() => {
  	return getClassNames(props);
});

// 初始化控制器
const controller = useController(props, evt);

useNavParamsBind(controller, props);

const store: ITabExpViewStore = controller.getStore();

onMounted(() => {
    controller.viewMounted();
})

onUnmounted(() => {
    controller.viewDestroy();
})
</script>
